package tk.zater.Util;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

public class ApplicationGetter implements ApplicationContextAware {

	private static ApplicationContext ctx;

	public static Object Getbean(String id) {
		return ctx.getBean(id);

	}

	@Override
	public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
		// TODO Auto-generated method stub
		
		ctx = applicationContext;
		System.out.println("--------------------------"+ctx);
	}

}